base-4.2.0.1: Basic librariesSource codeContentsIndex
Text.Read.Lex
Portabilitynon-portable (uses Text.ParserCombinators.ReadP)
Stabilityprovisional
Maintainerlibraries@haskell.org
Description
The cut-down Haskell lexer, used by Text.Read
Synopsis
data Lexeme
= Char Char
| String String
| Punc String
| Ident String
| Symbol String
| Int Integer
| Rat Rational
| EOF
lex :: ReadP Lexeme
hsLex :: ReadP String
lexChar :: ReadP Char
readIntP :: Num a => a -> (Char -> Bool) -> (Char -> Int) -> ReadP a
readOctP :: Num a => ReadP a
readDecP :: Num a => ReadP a
readHexP :: Num a => ReadP a
Documentation
data Lexeme Source
Haskell lexemes.
Constructors
Char CharCharacter literal
String StringString literal, with escapes interpreted
Punc StringPunctuation or reserved symbol, e.g. (, ::
Ident StringHaskell identifier, e.g. foo, Baz
Symbol StringHaskell symbol, e.g. >>, :%
Int IntegerInteger literal
Rat RationalFloating point literal
EOF
show/hide Instances
lex :: ReadP LexemeSource
hsLex :: ReadP StringSource
Haskell lexer: returns the lexed string, rather than the lexeme
lexChar :: ReadP CharSource
readIntP :: Num a => a -> (Char -> Bool) -> (Char -> Int) -> ReadP aSource
readOctP :: Num a => ReadP aSource
readDecP :: Num a => ReadP aSource
readHexP :: Num a => ReadP aSource
Produced by Haddock version 2.6.1